<?
	if (!defined('i-Teck_ADMIN')) die("Hacking attempt");

	switch($mod){
		case "edit":
		$result=mysql_query("SELECT * FROM shop_config where id=1");	
		while($r=mysql_fetch_array($result)){
		?>
<form id="form1" name="form1" method="post">
  		<article class="module width_full">
			<header><h3>Cấu hình website</h3></header>
				<div class="module_content">				
				<fieldset>
							<label>URL Web</label>
						    <input name="web_url" type="text" id="web_url" size="50" value="<?=stripslashes($r['web_url']);?>" />
				</fieldset>			
				<fieldset>
							<label>Tiêu đề web</label>
						    <input name="web_title" type="text" id="web_title" size="50" value="<?=stripslashes($r['web_title']);?>" />
				</fieldset>	
				<fieldset>
							<label>Quảng Cáo hai Bên</label>
						    <input type="radio" name="seo_url"  value="1" <? if($r['seo_url']==1){echo'checked="checked"';}?>/> Có
							<input type="radio" name="seo_url"  value="0"<? if($r['seo_url']==0){echo'checked="checked"';}?>/> Không
				</fieldset>
				<fieldset>
							<label>Số điện thoại</label>
						    <input name="web_phone" type="text" id="web_phone" size="50" value="<?=stripslashes($r['web_phone']);?>" />
				</fieldset>
				<fieldset>
							<label>Địa chỉ</label>
						    <input name="web_add" type="text" id="web_add" size="50" value="<?=stripslashes($r['web_add']);?>" />
				</fieldset>
				<fieldset>
							<label>Giờ làm việc</label>
						    <input name="web_nic1" type="text" id="web_nic1" size="50" value="<?=stripslashes($r['web_nic1']);?>" />
				</fieldset>
				<fieldset>
							<label>E-mail</label>
						    <input name="web_nic2" type="text" id="web_nic2" size="50" value="<?=stripslashes($r['web_nic2']);?>" />
				</fieldset>
				<fieldset>
							<label>Hiện Tin Nhanh Trang Sản Phẩm</label>
						    <input type="radio" name="keywords"  value="1" <? if($r['keywords']==1){echo'checked="checked"';}?>/> Có
							<input type="radio" name="keywords"  value="0"<? if($r['keywords']==0){echo'checked="checked"';}?>/> Không
				</fieldset>
						
					<input type="submit" name="cmd" id="cmd" value="Sửa" class="alt_btn">
				</div>
		</article><!-- end of styles article -->
</form>
<? }?>
<?
	//$act = (isset($_REQUEST["act"])) ? $_REQUEST["act"] : "";
if(isset($_POST["cmd"])=="Sửa"){ 
		mysql_query("UPDATE shop_config SET 
					web_url='".addslashes($_POST['web_url'])."', 
					web_title='".addslashes($_POST['web_title'])."', 
					seo_url='".addslashes($_POST['seo_url'])."', 
					web_phone='".addslashes($_POST['web_phone'])."', 
					web_add='".addslashes($_POST['web_add'])."', 
					web_nic1='".addslashes($_POST['web_nic1'])."', 
					web_nic2='".addslashes($_POST['web_nic2'])."', 
					keywords='".addslashes($_POST['keywords'])."' WHERE id=1");
		mysql_close();
		echo "<meta http-equiv='refresh' content='0; url=?act=config&mod=ok'>";
	}

	break; 
	case"ok":
		echo"<center>Đã sửa xong!</center>
		<script>setTimeout(\"window.location='?act=config&mod=edit';\", 1000);</script></center>";
	break;
	

}?>
